<template>
	<view>
		<view class="weight-list-wrapper">
			<view class="weight-item" v-for="(item, index) in weight_list" :key="index">
				<text class="weight">{{ item.weight }}<text>公斤</text></text>
				<text class="info">{{ item.plan_name }}<br>{{ $db.timeStampToTime(Number(item.ctime) * 1000) }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				weight_list: []
			};
		},
		mounted() {
			this.getData();
		},
		methods: {
			getData: function() {
				this.$api.getWeight()
					.then(res => {
						console.log(res);
						this.weight_list = res.data
					})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #FFFFFF;
		overflow: hidden;
	}

	.weight-list-wrapper {
		.weight-item {
			padding: 26rpx 45rpx 50rpx;
			display: flex;
			justify-content: space-between;

			.weight {
				color: #363636;
				font-size: 40rpx;

				text {
					padding-left: 10rpx;
					font-size: 22rpx;
				}
			}

			.info {
				color: #ABACB1;
				font-size: 22rpx;
				text-align: right;
			}
		}
	}
</style>
